/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "Flight")
@NamedQueries({
    @NamedQuery(name = "Flight.findAll", query = "SELECT f FROM Flight f"),
    @NamedQuery(name = "Flight.findByFlightID", query = "SELECT f FROM Flight f WHERE f.flightID = :flightID"),
    @NamedQuery(name = "Flight.findByFlightName", query = "SELECT f FROM Flight f WHERE f.flightName = :flightName"),
    @NamedQuery(name = "Flight.findByTicketType", query = "SELECT f FROM Flight f WHERE f.ticketType = :ticketType"),
    @NamedQuery(name = "Flight.findByPrice", query = "SELECT f FROM Flight f WHERE f.price = :price"),
    @NamedQuery(name = "Flight.findByDepartTime", query = "SELECT f FROM Flight f WHERE f.departTime = :departTime"),
    @NamedQuery(name = "Flight.findByDescription", query = "SELECT f FROM Flight f WHERE f.description = :description")})
public class Flight implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "flightID")
    private Integer flightID;
    @Column(name = "flightName")
    private String flightName;
    @Column(name = "ticketType")
    private String ticketType;
    @Column(name = "price")
    private BigDecimal price;
    @Column(name = "departTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date departTime;
    @Column(name = "description")
    private String description;

    public Flight() {
    }

    public Flight(Integer flightID) {
        this.flightID = flightID;
    }

    public Integer getFlightID() {
        return flightID;
    }

    public void setFlightID(Integer flightID) {
        this.flightID = flightID;
    }

    public String getFlightName() {
        return flightName;
    }

    public void setFlightName(String flightName) {
        this.flightName = flightName;
    }

    public String getTicketType() {
        return ticketType;
    }

    public void setTicketType(String ticketType) {
        this.ticketType = ticketType;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Date getDepartTime() {
        return departTime;
    }

    public void setDepartTime(Date departTime) {
        this.departTime = departTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (flightID != null ? flightID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Flight)) {
            return false;
        }
        Flight other = (Flight) object;
        if ((this.flightID == null && other.flightID != null) || (this.flightID != null && !this.flightID.equals(other.flightID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.Flight[flightID=" + flightID + "]";
    }

}
